package com.suredy.base.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

@Entity
@Table(name = "V_E_QZ")
public class Role {

	@Column(name = "ID")
	private String id;

	@Column(name = "groupName")
	private String groupName;

	@Column(name = "MC")
	private String mc;

	@Column(name = "QC")
	private String qc;

	private Set<User> userSet = new HashSet<User>();

	@Id
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getGroupName() {
		return this.groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	/**
	 * @return the name
	 */
	public String getMc() {
		return mc;
	}

	/**
	 * @param name the name to set
	 */
	public void setMc(String name) {
		this.mc = name;
	}

	/**
	 * @return the fullName
	 */
	public String getQc() {
		return qc;
	}

	/**
	 * @param fullName the fullName to set
	 */
	public void setQc(String fullName) {
		this.qc = fullName;
	}

	@OneToMany(fetch = FetchType.EAGER)
	@Cascade({org.hibernate.annotations.CascadeType.ALL})
	@JoinTable(name = "T_E_QZYH", joinColumns = {@javax.persistence.JoinColumn(name = "ID_E_QZ")}, inverseJoinColumns = {@javax.persistence.JoinColumn(name = "ID_E_YH")})
	public Set<User> getUserSet() {
		return this.userSet;
	}

	public void setUserSet(Set<User> userSet) {
		this.userSet = userSet;
	}
}
